package router

import (
	"GinTemplate/conf"
	"github.com/gin-gonic/gin"
)

func NewGinRouter(middlewares ...gin.HandlerFunc) *gin.Engine {
	gin.SetMode(conf.Cfg.Server.Mode)
	router := gin.Default()

	if len(middlewares) > 0 {
		router.Use(middlewares...)
	}
	return router
}
